package model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.print.attribute.standard.MediaSize.Other;

@Entity
@Table(name = "orders")
public class Orders {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "ordersID")
	private int ordersID;

	@ManyToOne(targetEntity = Customers.class)
	@JoinColumn(name = "customerID")
	private Customers customerID;

	@Column(name = "orderDate", length = 45)
	private String orderDate;

	@Column(name = "ordersPrice")
	private float ordersPrice;

	@OneToMany(targetEntity = Orderdetails.class)
	private Set order = new HashSet(0);

	public Orders() {
		// TODO Auto-generated constructor stub
	}

	public Orders(Customers customerID, String orderDate, float ordersPrice,
			Set order) {
		this.customerID = customerID;
		this.orderDate = orderDate;
		this.ordersPrice = ordersPrice;
		this.order = order;
	}

	public int getOrdersID() {
		return ordersID;
	}

	public void setOrdersID(int ordersID) {
		this.ordersID = ordersID;
	}

	public Customers getCustomerID() {
		return customerID;
	}

	public void setCustomerID(Customers customerID) {
		this.customerID = customerID;
	}

	public String getOrderDate() {
		return orderDate;
	}

	public void setOrderDate(String orderDate) {
		this.orderDate = orderDate;
	}

	public float getOrdersPrice() {
		return ordersPrice;
	}

	public void setOrdersPrice(float ordersPrice) {
		this.ordersPrice = ordersPrice;
	}

	public Set getOrder() {
		return order;
	}

	public void setOrder(Set order) {
		this.order = order;
	}
}
